package com.example.vpdemo;

import android.util.Log;

import com.example.middle_connect.dealInterface;

import static android.content.ContentValues.TAG;

//创建类
public class Mirror {
    String name;
    int age;
    boolean sex;
    Icho icho;
    dealInterface ideal;
    private void sleep() {

    }

    private Mirror(){}
    String sleep(String ss) {
        Log.d(TAG, "sleep: ");
        return "Mirror类sleep返回的字符串";
    }

    void cal_add(int a,int b, final Icho icho) {
        this.icho = icho;
        add(a,b);
    }
    void   add(int a,int b){

        int result=a+b;
        if (icho != null) {
            icho.backString(String.valueOf(result));
        }
        if (ideal!=null) {
            ideal.passResult(String.valueOf(result));
        }

    };
    void cal_add(int a,int b, dealInterface  ideal) {
        this.ideal = ideal;
        add(a,b);
    }

}

interface Icho {
    void backString(String ss);
}